#ifndef	 	_GATEWAY_H_
#define		_GATEWAY_H_

#include <stdio.h>
#include <sys/types.h>  
#include <sys/stat.h>   
#include <fcntl.h>      
#include <errno.h>     
#include <string.h>
#include <stdlib.h>  
#include <sys/epoll.h>  
#include <netinet/in.h>  
#include <unistd.h>  
#include <sys/socket.h>
#include <netinet/tcp.h>


#include "link.h"

int SetTcpKeepalive(int fd, unsigned int start, 
					unsigned int interval, unsigned int count); 
int ServerInit(const char *ip, const int port);
int ClientInit(const char *ip, const int port);
int	SetNonblockMode(int fd);
int ReadEvent(const int fd, LinkData *data);
int ListenEvent(const int sockfd);
int AddEvent(int fd, int epfd, int flag);
void delay(unsigned int sec, unsigned int ms);
void PrintTime(char *p);


#endif
